package online.hxstart.code.concurrent.chapter07;

import java.util.concurrent.TimeUnit;

/**
 * @author huxing
 * @date 19-5-31 星期五 下午8:59
 * @describe
 */
public class EmptyExceptionHandler {

  public static void main(String[] args) {
    //
    ThreadGroup mainGroup = Thread.currentThread().getThreadGroup();
    System.out.println(mainGroup.getName());
    System.out.println(mainGroup.getParent());
    System.out.println(mainGroup.getParent().getParent());

    final Thread thread =
        new Thread(
            () -> {
              try {
                TimeUnit.SECONDS.sleep(1);
              } catch (InterruptedException e) {
                e.printStackTrace();
              }
              System.out.println(1 / 0);
            },
            "Test-Thread");
    thread.start();
  }

}
